home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / mui / bcc.lha / BCC / Examples / BCCopts / Popdir.bc < prev    next >
Encoding:
Text File  |  1997-06-10  |  1.0 KB  |  44 lines

  1. #include <proto/asl.h>
  2. #include <string.h>
  3.  
  4. #include "Popdir.bh"
  5.  
  6. __asm __saveds ULONG paStart( register __a1 ULONG *tags, register __a2 Object *obj )
  7. {
  8.  
  9.     *(tags++) = ASLFR_DrawersOnly;
  10.     *(tags++) = TRUE;
  11.     *(tags++) = ASLFR_InitialDrawer;
  12.     *(tags++) = BCC_XGet( (Object*)BCC_XGet( obj, MUIA_Popstring_String ), MUIA_String_Contents );
  13.     *(tags++) = TAG_DONE;
  14.  
  15.     return TRUE;
  16.  
  17. }
  18.  
  19. __asm __saveds ULONG paClose( register __a1 struct FileRequester *fr, register __a2 Object *obj )
  20. {
  21.  
  22.     PopdirData *data = INST_DATA( cl_Popdir->mcc_Class, obj );
  23.  
  24.     strcpy( data->dir, fr->fr_Drawer );
  25.  
  26.     DoMethod( (Object*)BCC_XGet( obj, MUIA_ApplicationObject ), MUIM_Application_PushMethod, (Object*)BCC_XGet( obj, MUIA_Popstring_String ), 3, MUIM_Set, MUIA_String_Contents, data->dir );
  27.  
  28.     return TRUE;
  29.  
  30. }
  31.  
  32. static const struct Hook shook = { { NULL,NULL },(VOID *)paStart,NULL,NULL };
  33. static const struct Hook chook = { { NULL,NULL },(VOID *)paClose,NULL,NULL };
  34.  
  35. Method Popdir::Popdir():
  36.     MUIA_Popasl_Type, ASL_FileRequest,
  37.     MUIA_Popasl_StartHook, &shook,
  38.     MUIA_Popasl_StopHook, &chook
  39. {
  40.  
  41.  
  42. }
  43.  
  44.